//
//  MacroDefinition.h
//  CarPooling
//
//  Created by Dxc_iOS on 2018/5/14.
//  Copyright © 2018年 代星创. All rights reserved.
//

#ifndef MacroDefinition_h
#define MacroDefinition_h

/**
 获取屏幕 宽度、高度
 */
#define  HDScreenWidth  [UIScreen mainScreen].bounds.size.width
#define  HDScreenHeight [UIScreen mainScreen].bounds.size.height

/**
 适配iPhoneX
 */
#define IsIphoneX  ([UIScreen instancesRespondToSelector:@selector(currentMode)]?CGSizeEqualToSize(CGSizeMake(1125, 2436),[[UIScreen mainScreen] currentMode].size):NO)

#define NaviHight       (IsIphoneX?88:64)
#define TabBarHight     (IsIphoneX?83:49)
#define StatusBarHight  (IsIphoneX?44:20)
#define BottomHight     (IsIphoneX?34:0)

#define HightNoNav            HDScreenHeight-NaviHight
#define HightNoNavAndTabbar   HDScreenHeight-NaviHight-TabBarHight
#define HightNoTabbar         HDScreenHeight-TabBarHight


/**
 宽度比例
 */
#define ScaleW(__VA_ARGS__)  ([UIScreen mainScreen].bounds.size.width/375)*(__VA_ARGS__)
#define  W(X) ((HDScreenWidth) * ((X) / 375.0f))

/**
 高度比例
 */
#define ScaleH(__VA_ARGS__)  ([UIScreen mainScreen].bounds.size.height/667)*(__VA_ARGS__)
#define  H(Y)    (IsIphoneX?((HDScreenHeight)*((Y)/812.0f)):((HDScreenHeight) *((Y)/667.0f)))

/**
 全局字体
 */
#define HDFont(__VA_ARGS__) ([UIFont systemFontOfSize:ScaleW(__VA_ARGS__)])

/**
 图片
 */
#define IMAGE_Original(imageName) [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
#define IMAGE(imageName) [UIImage imageNamed:imageName]
/**
 设置颜色
 */
#define RGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
/**
 随机颜色
 */
#define RandomColor [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1]
/**
 分割线颜色
 */
#define separeLineColor RGB(206,206,206)

//themeColor
#define themedColor        [Tools hexStringToColor:@"ff6e3c"]
#define BgColor            [Tools hexStringToColor:@"F4F4F7"]
#define BgBlueColor        [Tools hexStringToColor:@"599efe"]
#define BgRedColor         [Tools hexStringToColor:@"fe6f4e"]
#define TextBigColor       [Tools hexStringToColor:@"333333"]
#define TextColor          [Tools hexStringToColor:@"5E5E5E"]
#define TextLightColor     [Tools hexStringToColor:@"cccccc"]
#define LineColor          [Tools hexStringToColor:@"CCCCCC"]
#define LoginBtnColor      [Tools hexStringToColor:@"#424241"]
#define PriceColor         [UIColor colorWithHexString:@"#ee2742"]
/**
 weakSelf
 */
#define HDWeakSelf(type)  __weak typeof(type) weak##type = type;
#define HDStrongSelf(type)  __strong typeof(type) type = weak##type;

#endif /* MacroDefinition_h */
